import 'package:built_collection/built_collection.dart';
import 'package:equatable/equatable.dart';
import 'package:mobile_app.core/core/domain/entities/learning_content/collection_list_item/collection_list_item.dart';
import 'package:mobile_app.home.core/core/domain/entities/card_actions/card_action.dart';

class AdditionToCustomCollectionCardAction extends Equatable implements CardAction {
  const AdditionToCustomCollectionCardAction({
    required this.permitted,
    required this.collectionInfos,
  });

  final bool permitted;
  final BuiltList<AdditionToCustomCollectionCardActionCollectionInfo> collectionInfos;

  @override
  List<Object?> get props {
    return [
      permitted,
      collectionInfos,
    ];
  }

  AdditionToCustomCollectionCardAction copyWith({
    bool Function()? permitted,
    BuiltList<AdditionToCustomCollectionCardActionCollectionInfo> Function()? collectionInfos,
  }) {
    return AdditionToCustomCollectionCardAction(
      permitted: permitted == null ? this.permitted : permitted(),
      collectionInfos: collectionInfos == null ? this.collectionInfos : collectionInfos(),
    );
  }
}

class AdditionToCustomCollectionCardActionCollectionInfo extends Equatable {
  const AdditionToCustomCollectionCardActionCollectionInfo({
    required this.customCollection,
    required this.collectionPermitted,
    required this.collectionFolderTitle,
  });

  final CustomCollection customCollection;
  final bool collectionPermitted;
  final String? collectionFolderTitle;

  @override
  List<Object?> get props {
    return [
      customCollection,
      collectionPermitted,
      collectionFolderTitle,
    ];
  }
}
